<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book 我的电子书 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>文本溢出处理 | 我的电子书</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        <meta name="author" content="Melon">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-image-captions/image-captions.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    
    <link rel="prev" href="../../md/02css/position.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="2.8"
        data-chapter-title="文本溢出处理"
        data-filepath="md/02css/textoverflow.md"
        data-basepath="../.."
        data-revision="Mon Jun 08 2020 19:44:34 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/01html/01label.html">
            
                
                    <a href="../../md/01html/01label.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML标签
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/01html/boxmodel.html">
            
                
                    <a href="../../md/01html/boxmodel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/01html/nvmgitbook.html">
            
                
                    <a href="../../md/01html/nvmgitbook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        nvm和gitbook
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/02css/index.html">
            
                
                    <a href="../../md/02css/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/02css/01selector.html">
            
                
                    <a href="../../md/02css/01selector.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/02css/element_center.html">
            
                
                    <a href="../../md/02css/element_center.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        元素垂直居中的方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/02css/Interview.html">
            
                
                    <a href="../../md/02css/Interview.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        面试题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/02css/displayvisibility.html">
            
                
                    <a href="../../md/02css/displayvisibility.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        元素的显示模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/02css/float.html">
            
                
                    <a href="../../md/02css/float.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/02css/media.html">
            
                
                    <a href="../../md/02css/media.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        media媒体查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/02css/position.html">
            
                
                    <a href="../../md/02css/position.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.8" data-path="md/02css/textoverflow.html">
            
                
                    <a href="../../md/02css/textoverflow.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        文本溢出处理
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >我的电子书</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x6587;&#x5B57;&#x6EA2;&#x51FA;&#x6587;&#x672C;&#x9690;&#x85CF;">&#x6587;&#x5B57;&#x6EA2;&#x51FA;&#x6587;&#x672C;&#x9690;&#x85CF;</h1>
<h3 id="&#x5355;&#x884C;&#x6587;&#x672C;&#x6EA2;&#x51FA;&#x663E;&#x793A;&#x7701;&#x7565;&#x53F7;">&#x5355;&#x884C;&#x6587;&#x672C;&#x6EA2;&#x51FA;&#x663E;&#x793A;&#x7701;&#x7565;&#x53F7;</h3>
<ul>
<li>1.&#x5148;&#x5F3A;&#x5236;&#x4E00;&#x884C;&#x5185;&#x663E;&#x793A;&#x6587;&#x672C;<pre><code class="lang-css"><span class="hljs-tag">white-spacing</span>&#xFF1A;<span class="hljs-tag">nowrap</span>
</code></pre>
</li>
<li>2.&#x8D85;&#x51FA;&#x90E8;&#x5206;&#x9690;&#x85CF;&#xFF0C;&#x6CE8;&#x610F;&#xFF1A;&#x8981;&#x8BBE;&#x7F6E;&#x76D2;&#x5B50;&#x5BBD;&#x548C;&#x9AD8;<pre><code class="lang-css"><span class="hljs-tag">overflow</span>&#xFF1A;<span class="hljs-tag">hidden</span>
</code></pre>
</li>
<li>3.&#x6587;&#x5B57;&#x7528;&#x7701;&#x7565;&#x53F7;&#x4EE3;&#x66FF;&#x8D85;&#x51FA;&#x90E8;&#x5206;<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">text-overflow</span>:<span class="hljs-value">ellipsis
</span></span></code></pre>
</li>
<li>overflow<ul>
<li><code>visible</code> &#x9ED8;&#x8BA4;&#x503C; &#x8D85;&#x51FA;&#x90E8;&#x5206;&#x53EF;&#x89C1;</li>
<li><code>hidden</code> &#x9690;&#x85CF; &#x8D85;&#x51FA;&#x90E8;&#x5206;&#x9690;&#x85CF;</li>
<li><code>scroll</code> &#x6EDA;&#x52A8;&#x6761; &#x8D85;&#x51FA;&#x7684;&#x90E8;&#x5206;&#x7528;&#x6EDA;&#x52A8;&#x6761;&#x663E;&#x793A;</li>
<li><code>auto</code> &#x6EDA;&#x52A8;&#x6761; &#x5185;&#x5BB9;&#x8D85;&#x51FA;&#x65F6;&#x624D;&#x4F1A;&#x51FA;&#x73B0;&#x6EDA;&#x52A8;&#x6761;<h4 id="&#x5F3A;&#x8C03;-overflow&#xFF1A;hidden-&#x8981;&#x614E;&#x7528;">&#x5F3A;&#x8C03; overflow&#xFF1A;hidden &#x8981;&#x614E;&#x7528;</h4>
</li>
</ul>
</li>
</ul>
<h3 id="&#x591A;&#x884C;&#x6587;&#x672C;&#x6EA2;&#x51FA;&#x663E;&#x793A;&#x7701;&#x7565;&#x53F7;">&#x591A;&#x884C;&#x6587;&#x672C;&#x6EA2;&#x51FA;&#x663E;&#x793A;&#x7701;&#x7565;&#x53F7;</h3>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">display</span>:<span class="hljs-value"> -webkit-box</span></span>;
<span class="hljs-rule"><span class="hljs-attribute">-webkit-box-orient</span>:<span class="hljs-value"> vertical</span></span>;
<span class="hljs-rule"><span class="hljs-attribute">-webkit-line-clamp</span>:<span class="hljs-value"> <span class="hljs-number">2</span></span></span>;
<span class="hljs-rule"><span class="hljs-attribute">overflow</span>:<span class="hljs-value"> hidden</span></span>;
<span class="hljs-rule"><span class="hljs-attribute">text-overflow</span>:<span class="hljs-value"> ellipsis</span></span>;
</code></pre>
<pre><code class="lang-html">&#x6269;&#x5C55;: -webkit-line-clamp &#x662F;&#x4E00;&#x4E2A; &#x4E0D;&#x89C4;&#x8303;&#x7684;&#x5C5E;&#x6027;&#xFF08;unsupported WebKit property&#xFF09;&#xFF0C;&#x5B83;&#x6CA1;&#x6709;&#x51FA;&#x73B0;&#x5728; CSS &#x89C4;&#x8303;&#x8349;&#x6848;&#x4E2D;&#x3002;
</code></pre>
<h5 id="&#x4E3A;&#x4E86;&#x5B9E;&#x73B0;&#x8BE5;&#x6548;&#x679C;&#xFF0C;&#x5B83;&#x9700;&#x8981;&#x7EC4;&#x5408;&#x5176;&#x4ED6;&#x5916;&#x6765;&#x7684;webkit&#x5C5E;&#x6027;&#x3002;&#x5E38;&#x89C1;&#x7ED3;&#x5408;&#x5C5E;&#x6027;&#xFF1A;">&#x4E3A;&#x4E86;&#x5B9E;&#x73B0;&#x8BE5;&#x6548;&#x679C;&#xFF0C;&#x5B83;&#x9700;&#x8981;&#x7EC4;&#x5408;&#x5176;&#x4ED6;&#x5916;&#x6765;&#x7684;WebKit&#x5C5E;&#x6027;&#x3002;&#x5E38;&#x89C1;&#x7ED3;&#x5408;&#x5C5E;&#x6027;&#xFF1A;</h5>
<ul>
<li>display: -webkit-box; &#x5FC5;&#x987B;&#x7ED3;&#x5408;&#x7684;&#x5C5E;&#x6027; &#xFF0C;&#x5C06;&#x5BF9;&#x8C61;&#x4F5C;&#x4E3A;&#x5F39;&#x6027;&#x4F38;&#x7F29;&#x76D2;&#x5B50;&#x6A21;&#x578B;&#x663E;&#x793A; &#x3002;</li>
<li>-webkit-box-orient &#x5FC5;&#x987B;&#x7ED3;&#x5408;&#x7684;&#x5C5E;&#x6027; &#xFF0C;&#x8BBE;&#x7F6E;&#x6216;&#x68C0;&#x7D22;&#x4F38;&#x7F29;&#x76D2;&#x5BF9;&#x8C61;&#x7684;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x6392;&#x5217;&#x65B9;&#x5F0F; &#x3002;</li>
<li>text-overflow&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x591A;&#x884C;&#x6587;&#x672C;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x7528;&#x7701;&#x7565;&#x53F7;&#x201C;...&#x201D;&#x9690;&#x85CF;&#x8D85;&#x51FA;&#x8303;&#x56F4;&#x7684;&#x6587;&#x672C; &#x3002;</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/02css/position.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 定位"><i class="fa fa-angle-left"></i></a>
        
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"image-captions":{"attributes":{"style":"left: 50%;position: relative;transform: translateX(-50%);"},"caption":"图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_","align":"center","variable_name":"_pictures"},"fontsettings":{"theme":"night","family":"sans","size":2},"toggle-chapters":{},"highlight":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book 我的电子书 -->
</html>
